home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / programr / bcpp / cmmdlg / readme.1st < prev    next >
Text File  |  1992-09-16  |  4KB  |  115 lines

  1. This code was made  by
  2.     Juancarlo A#ez
  3.     [73000,1064]
  4.  
  5. CONTENTS
  6.    0///INTRO
  7.    1///WHAT IT'S ABOUT
  8.    2///HOW IT WORKS
  9.    3///LIMITATIONS
  10.    4///BUGS
  11.    5///CAVEATS&TECHNIQUES
  12.  
  13. This code intended for any use, completely free.  Allthough I will denay
  14. any responsability on any harm you cause with it, even if the code is
  15. full off bugs.  There ar no warranties expressed or implied.
  16.  
  17. But if you like it...please PAY FORWARD.
  18.  
  19. 1/////WHAT IT'S ABOUT
  20.  
  21. This units show how to build a tDialog descendant shell arround CommonDialogs
  22. so you can, frinstance, use BWCC styles or add your own controls for 
  23. app specific options.  There's also a Windows 3.1 complying tPrinter OBJECT in
  24. the PRN31_ UNIT. It is based on PRINTER.ZIP in BPROGA Lib 8 and my own code.  
  25. The main difference lies in that PRN31_ takes a tUsrWin descendant instead
  26. of a tPrintable for printing.  tUsrWins know how to print themselves (at least
  27. in what you see on screen, but with several limitations).  CAVEAT EMPTOR 
  28. WYSIWIG is up to you.
  29.  
  30. UNITS
  31.  
  32. USRWIN_.PAS   This unit defines tUsrWin, a tWindow descendant that makes 
  33.           painting easier, and is capable of printing itself.
  34.  
  35. PORT_.PAS     Defines tPort, a shell around HDC's (GDI Device Contexts).  
  36.           There are some basic methods there to ease your work.  Also,
  37.               tPrinter descends from this object, making it nearly the same
  38.               for tUsrWin to paint or print.
  39.  
  40. PRN31_.PAS    This unit defines the new tPrinter object, that knows about
  41.               tUsrWins and how to tell them to print themselves.
  42.  
  43. COMONDLG.PAS  Unit defining the tCommonDlg basic object descendand of tDialog.
  44.           Do take a look at it!
  45.  
  46. FNAMEDLG.PAS  Unit defining the tFileNameDlg object, descendand of tCommonDlg.
  47.           This object handles Open and SaveAs dialogs, trough a boolean
  48.           variable.
  49.  
  50. PRINTDLG.PAS  This unit contains the dialog deffinitions that shell the 
  51.               Common Dialog PRINT and PRINTER SETUP dialogs.
  52.  
  53. COMOSAMP.PAS  This is the main program.  It is a modification of the 
  54.               COMMDLG.PAS sample program that comes with TPW 1.5.
  55.  
  56. MY......PAS   Theese are units that show how to override the basic 
  57.               common dialog objects, to get them to do what you want.
  58.               (frinstance, set your own file Spec and Extension in a 
  59.                FileOpen or FileSaveAs dialog).
  60.  
  61. 2///HOW IT WORKS
  62.  
  63. Compile and run with COMOSAMP as the main program.  Things will show up just 
  64. as in the TPW1.5 example.  Choose "Use BWCC" from the File menu and try again
  65. to see things rolling.
  66.  
  67. Take a special look at the File/Open dialog to get a hint of the usefullness
  68. of the tCommonDlg objects.
  69.  
  70. 3/////LIMITATIONS
  71.  
  72. I diddn't have time to build the to build tChooseFontDlg and tChooseColorDlg
  73. but the technique is the same as for tFileNameDlg and the printer dialogs, so
  74. it should be easy if you need them.
  75.  
  76. Neither had time to get onto the ChooseColor dialog, so you'll see it just
  77. as Microsoft intendet to.
  78.  
  79. 4///BUGS
  80.  
  81. I couldn't make the BWCC-style ChooseFont dialog show the font sample.  Mabe
  82. some incompatibility with BWCC.  If you work this out, please let me know.
  83. Better, let us ALL know!.  (Same problem should show up with ChooseColor)
  84.  
  85. 5///CAVEATS&TECHNIQUES
  86.  
  87. The whole trick is placing a dialog name in the lpTemplateName of the 
  88. TOPENFILE, TPRINTDLG, etc.  structures.  This makes YOUR dialogs show up
  89. instead of Microsoft's.  You also have to use the xx_EnableTemplateName in
  90. the flags field.  The printer dialogs are a bit more tricky, so take a closer
  91. look at them.
  92.  
  93. The way to build your *common* dialogs is to steal them from the COMMONDLG.DLL
  94. in the WINDOWS\SYSTEM directory.  You do this by launching two copies of
  95. ResourceWorkshop.  One holds COMMONDLG.DLL resources and the other your own.
  96. Then you just CUT (from DLL) and PASTE (into yours). Easy!
  97.  
  98. CAVEAT:  Don't change control ID's or use near-numbered ID's for your new
  99. controls.  Number your controls in another range.  CommonDlg controls are
  100. arround 1000 to 1100, choose 7000... for yours.
  101.  
  102. CAVEAT: I think there's a technique for making *additional* buttons, such as
  103. SETUP in PrintDlg and HELP in all, show as BWCC bitmapped...but I think it's
  104. not *legal* (and it's not debugged) so I'd like to discuss it in the forum
  105. first.
  106.  
  107. Greetings,
  108.  
  109.  \\\
  110. -(j)-
  111.   /juanca
  112.  
  113. and PAY FORWARD
  114.  
  115.